import Vue from 'vue'
import Router from 'vue-router'
import Find from '@/components/nav/Find'
import Read from '@/components/nav/Read'
import Communication from '@/components/Communication'
import News from '@/components/nav/News'
import Content from '@/components/Content'
import Category from '@/components/Category'
import Todo from '@/components/Todo'
import Logout from '@/components/Logout'
// 投票模块
import ProjectStat from '@/components/project/ProjectStat'
// 问答模块
import Answers from '@/components/know-how/Answers'
import AskDetail from '@/components/know-how/AskDetail'
import Askquestion from '@/components/know-how/Askquestion'
// 云课堂
import Coursegroup from '@/components/know-how/Coursegroup'
import CourseDetail from '@/components/know-how/CourseDetail'
import UploadChapter from '@/components/know-how/UploadChapter'
import ViewCourseList from '@/components/know-how/ViewCourseList'
import CreateCourse from '@/components/Know-how/CreateCourse'
Vue.use(Router);
export default new Router({
  routes: [
    {// 默认页设置
      path: '/',
      component: Content,
      redirect:'/content'
    },
    {
      path: '/content',
      component: Content
    },
    {
      path:'/find',
      name:'find',
      component:Find
    },
    {
      path:'/read',
      name:'read',
      component:Read
    },
    {
      path:'/communication',
      name:'communication',
      component:Communication
    },
    {
      path:'/news',
      name:'news',
      component:News
    },
    {
      path:'/project/stat',
      name:'/project/stat',
      component:ProjectStat
    },
    {
      path:'/about',
      name:'todo',
      component:Todo
    },
    {
     path:"/logout",
     component:Logout
    },
     {// 问答主页面
      path:'/Know-how/answers',
      component:Answers
    },
    // 提问页
    {
      path:'/know-how/Askquestion/:searchIndex',
      component:Askquestion
    },
    {//问题详情页
      path:"/know-how/AskDetail/:id",
      component:AskDetail
    },
      // 提问页面
    {
     path:'/know-how/askquestion',
     component:Askquestion
    },
    {// 课程主页面
      path:'/Know-how/coursegroup',
      component:Coursegroup
    },
    { // 查看课程章节
      path:'/know-how/course/detail/:courseId',
      component:CourseDetail
    },
    { // 查看我的授课列表
      path: '/knowledge/course/my/list',
      component: ViewCourseList
    },
    { // 创建授课课程
      path: '/Know-how/course/create',
      component: CreateCourse
    },
    { // 上传课程章节视频
      path: '/Know-how/chapter/upload/:courseId/:topic',
      name: 'chapterUpload',
      component: UploadChapter
    },
  ]
})
